package boboLang;

public class BoboStringBuilder extends BoboAbstractStringBuilder {
    /*
    * 构造函数
    * */
    public BoboStringBuilder(){
        super(16);
    }
    public BoboStringBuilder(int capacity){
        super(capacity);
    }
    public BoboStringBuilder(BoboString str){
        super(str.length() + 16);
        append(str);
    }

    @Override
    public BoboStringBuilder append(BoboString boboString) {
        super.append(boboString);
        return this;
    }

    @Override
    public String toString() {
        //创建一个拷贝，不共享字符数组
        return new String(value, 0, count);
    }
}
